package com.nn.algorithm;

import java.util.Arrays;

public class Classifier {

	private final Network network = Network
			.buildNetworkWithOneHiddenLayer(false);
	private static double[] standing = { 1.0, 0.0, 0.0 };
	private static double[] walking = { 0.0, 1.0, 0.0 };
	private static double[] running = { 0.0, 0.0, 1.0 };

	public String classifyPattern(double[] inputValues) {
		double[] output = network.calculateRoundedOutput(inputValues);
		Persistence.printVector(output, 3);
		if (Arrays.equals(output, standing)) {
			return "Standing";
		} else if (Arrays.equals(output, walking)) {
			return "Walking";
		} else if (Arrays.equals(output, running)) {
			return "Running";
		}

		return "Undefined";
	}
	
	public static void main(String[] args) {
		
		Classifier classifier = new Classifier();
		double input_from_file_standing[][] = Persistence.readInput("Walking.txt");
		System.out.println(classifier.classifyPattern(input_from_file_standing[0]));
	}

}
